import 'package:xanno/src/anno/utils/base.dart';

class GJenkinsfile extends GBase {
  /// fir token
  final String token;

  /// 企业微信webHook，目前只支持企业微信
  final String webHook;

  /// 代码仓库git地址
  final String gitUrl;

  /// 符号表 shell symbol 使用&&连接
  final List<String> shellSymbol;

  /// branch
  final String branch;

  /// git merge target
  final String mergeTarget;

  /// android msg
  final String androidMsg;

  /// iOS msg
  final String iOSMsg;

  /// android build args
  /// 使用拆分包命令后，版号会被Android编译器加上前缀 例:10 => abi * 1000 + 10
  /// https://developer.android.com/studio/build/configure-apk-splits
  /// ```groovy
  /// 可以在gradle.android处理
  /// applicationVariants.all { variant ->
  ///     variant.outputs.each { output ->
  ///         output.versionCodeOverride = defaultConfig.versionCode
  ///     }
  /// }
  /// ```
  /// ```dart
  /// androidArgs: [
  ///   "--dart-define=AppStore=false",
  ///   "--target-platform=android-arm64",
  ///   "--split-per-abi",
  ///   "--obfuscate",
  ///   "--split-debug-info=build/app/splitdebuginfo",
  /// ]
  /// ```
  final List<String> androidArgs;

  /// iOS build args
  /// ```dart
  /// iOSArgs: [
  ///   "--dart-define=AppStore=false",
  ///   "--export-method=ad-hoc",
  ///   "--obfuscate",
  ///   "--split-debug-info=build/ios/splitdebuginfo",
  /// ]
  /// ```
  final List<String> iOSArgs;

  /// 是否初始化Jenkinsfile
  final bool enable;

  const GJenkinsfile({
    required this.token,
    required this.gitUrl,
    this.shellSymbol = const [],
    this.webHook = "",
    this.branch = "master",
    this.mergeTarget = "dev",
    this.androidMsg = "↑↑↑android包下载二维码,请同步给其他测试同事",
    this.iOSMsg = "↑↑↑iOS包下载二维码,请同步给其他测试同事",
    this.androidArgs = const [],
    this.iOSArgs = const [],
    this.enable = true,
  }) : super();
}
